/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "empresa_plano")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EmpresaPlano.findAll", query = "SELECT e FROM EmpresaPlano e")})
public class EmpresaPlano implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @JoinColumn(name = "ID_PLANO_CENTRO_RESULTADO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private PlanoCentroResultado idPlanoCentroResultado;
    @JoinColumn(name = "ID_PLANO_NATUREZA_FINANCEIRA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private PlanoNaturezaFinanceira idPlanoNaturezaFinanceira;
    @JoinColumn(name = "ID_PLANO_CONTA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private PlanoConta idPlanoConta;

    public EmpresaPlano() {
    }

    public EmpresaPlano(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public PlanoCentroResultado getIdPlanoCentroResultado() {
        return idPlanoCentroResultado;
    }

    public void setIdPlanoCentroResultado(PlanoCentroResultado idPlanoCentroResultado) {
        this.idPlanoCentroResultado = idPlanoCentroResultado;
    }

    public PlanoNaturezaFinanceira getIdPlanoNaturezaFinanceira() {
        return idPlanoNaturezaFinanceira;
    }

    public void setIdPlanoNaturezaFinanceira(PlanoNaturezaFinanceira idPlanoNaturezaFinanceira) {
        this.idPlanoNaturezaFinanceira = idPlanoNaturezaFinanceira;
    }

    public PlanoConta getIdPlanoConta() {
        return idPlanoConta;
    }

    public void setIdPlanoConta(PlanoConta idPlanoConta) {
        this.idPlanoConta = idPlanoConta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmpresaPlano)) {
            return false;
        }
        EmpresaPlano other = (EmpresaPlano) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.EmpresaPlano[ id=" + id + " ]";
    }
    
}
